#include <bits/stdc++.h>
using namespace std;

int cnt[100005];

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	int n;
	cin >> n;
	for (int i = 1;i <= n;i++)
	{
		int x;
		cin >> x;
		cnt[x]++;
	}
	int ans = 0,res = 0;
	for (int i = 1;i <= 100000;i++)
		if (cnt[i])
		{
			ans += min(res,cnt[i]);
			if (res > cnt[i]) res -= cnt[i];
			else res = 0;
			res += cnt[i];
		}
	cout << n - ans << endl;
	return 0;
}
